package com.hex.liyue.lookingdatemodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.usermodule.bean.MyMessageResultBean;

/**
 * Created by WJ on 2016/6/24.
 */
public class PersonDetailsPresenter {
    private IPersonDetailsView iPersonDetailsView;

    public PersonDetailsPresenter(IPersonDetailsView iPersonDetailsView) {
        this.iPersonDetailsView = iPersonDetailsView;
    }

    public void getProfile(String uid) {
        iPersonDetailsView.showLod("加载中...");
        HttpManager.getInstance().getMyMessage(uid, new ResponseListener<MyMessageResultBean>() {
            @Override
            public void onSuccess(MyMessageResultBean myMessageResultBean) {
                iPersonDetailsView.closeLod();
                iPersonDetailsView.setPersonDetails(myMessageResultBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iPersonDetailsView.closeLod();
                iPersonDetailsView.showT(responseresult);
            }
        });
    }
}
